﻿//Copyright@<2009> <Naveen>

using System;

// change file ame to MainMenu
public class MainMenu
{
    //private member variables
    private int mainUserInput;
    private static int UserInput;


    // public accessor method - MainMenuOptions()
    public static int MainMenuOptions()
    {
        try
        {
            do
            {
                //Display main menu options and get user's input 
                System.Console.WriteLine("Please enter one of the following numeric options\n");
                System.Console.WriteLine("1. Create an Account");
                System.Console.WriteLine("2. Login to the System");
                System.Console.WriteLine("3. Quit the System \n");

                MainMenu mainmenu = new MainMenu();
                System.Console.Write("Option: ");

                mainmenu.MainUserInput = Int32.Parse(Console.ReadLine());

                UserInput = mainmenu.MainUserInput;


            } while (UserInput != 1 && UserInput != 2 && UserInput != 3);


            return UserInput;

        }
        catch
        {
            System.Console.WriteLine("\nYou have entered an invalid option..... \n");
            MainMenuOptions();
            return int.Parse(null);
        }
   }
 




    public int MainUserInput
    {
        get
        {
            return mainUserInput;
        }

        set
        {
            mainUserInput = value;
        }

    }



}

